﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;

namespace TX
{
    class Util
    {
        protected void SummarizeOnFooter(ref DevExpress.XtraGrid.Columns.GridColumn col)
        {
            col.DisplayFormat.FormatType = DevExpress.Utils.FormatType.Numeric;
            col.DisplayFormat.FormatString = "#,###.##";
            col.SummaryItem.DisplayFormat = "Grand Total {0:N}";
            col.SummaryItem.SummaryType = DevExpress.Data.SummaryItemType.Sum;
        }

        protected void PostOperations(DevExpress.XtraGrid.Views.Grid.GridView gv, params bool[] showfooter)
        {
            if (showfooter.Length > 0)
                gv.OptionsView.ShowFooter = showfooter[0];
            gv.ExpandAllGroups();
            gv.BestFitColumns();
        }
    }
}
